{:W('Cate/header')}
{:W('Cate/left')}

<!--内容部分-->
<div class="content">
    <div class="title">
        <p>服务管理</p>
        <i class="icon-angle-right"></i>
        <p class="active">服务开通</p>
    </div>
    <div class="admin_list clearfix">
        <div class="main">
            <div class="main_title">
                <form action="{:U('open_record/open_service')}" method="get">
                    <ul class="clearfix">
                        <li>
                            <span>客户名称</span>
                            <input value="{$param.name}" maxlength="20" name="name" type="text">
                        </li>
                        <button><img src="__PUBLIC__/images/seach.png">搜索</button>
                    </ul>
                </form>
            </div>
            <div class="main_list" style="margin-top:15px;">
                <div class="main_list_list device_list">
                    <dl>
                        <dt>
                            <span style="width:5%">序号</span>
                            <span style="width:25%;text-align:left;padding-left:20px;">客户名称</span>
                            <span style="width:20%;text-align:left;padding-left:20px;">当前开通服务资源数</span>
                            <span style="width:20%;text-align:left;padding-left:20px;">累计开通服务资源数</span>
                            <span style="width:20%;text-align:left;padding-left:20px;">累计消费</span>
                            <span style="width:10%;text-align:left;padding-left:20px;"> 操作</span>
                        </dt>
                        <volist name="array['details']" id='row' key="k">
                        <dd>
                            <span style="width:5%">{$k}</span>
                            <span style="width:25%;text-align:left;padding-left:20px;">{$row['name']}</span>
                            <span style="width:20%;text-align:left;padding-left:20px;">{$row['inservice']}</span>
                            <span style="width:20%;text-align:left;padding-left:20px;">{$row['totalservice']}</span>
                            <span style="width:20%;text-align:left;padding-left:20px;">￥{$row['totalpay']}</span>
                            <span style="width:10%;text-align:left;padding-left:20px;"><a href="{:U('open_record/service_details',array('companyid'=>$row['id']))}">服务开通</a></span>
                        </dd>
                        </volist>
                    </dl>
                </div>
            </div>
            <div class="fy" id="page"></div>
        </div>
    </div>
</div>

</body>
<script>
    // 分页
    layui.use('laypage', function(){
        var laypage = layui.laypage;
        //执行一个laypage实例
        laypage.render({
            elem: 'page'
            ,count: "<?php echo $totnum; ?>"
            ,limit: "<?php echo $pagecount; ?>"
            ,layout: ['prev', 'page', 'next', 'limit', 'skip']
            ,curr:function(){
                var page = location.search.match(/pageid=(\d+)/);
                return page ? page[1] : 1;
            }()
            ,jump: function(obj,first){  //点击页码出发的事件
                if(first!=true){  //是否首次进入页面
                    var name = "<?php echo $param['name']; ?>";
                    var _url = "/open_record/open_service?pageid="+obj.curr+"&pagecount="+obj.limit;
                    if(name){
                        _url = "/open_record/open_service?pageid="+obj.curr+"&pagecount="+obj.limit+"&name="+name;
                    }
                    window.location.href = _url;
                }
            }
        });
    });


</script>
</html>